package com.winhxd.b2c.customer.service;

import com.winhxd.b2c.common.context.CustomerUser;
import com.winhxd.b2c.common.domain.customer.bo.CustomerRevenueBO;
import com.winhxd.b2c.common.domain.customer.condition.CustomerApplyWithDrawCondition;
import com.winhxd.b2c.common.domain.customer.vo.CustomerRevenueVO;
import com.winhxd.b2c.common.domain.customer.vo.CustomerWithdrawalsInfoVO;
import com.winhxd.b2c.common.domain.order.vo.OrderRebateRecordVO;

import java.math.BigDecimal;

/**
 * @author caiyulong
 */
public interface CustomerRevenueService {

    /**
     * 获取用户的收益信息
     * @param customerId
     * @param level
     * @return
     */
    CustomerRevenueVO getCustomerRevenue(Long customerId, Integer level);

    /**
     * 订单转正 计算奖励
     * @param orderRebateRecordVO
     */
    void orderClosedCalculateRevenue(OrderRebateRecordVO orderRebateRecordVO);

    /**
     * 更新用户收益积分缓存
     *  @param customerId
     * @param level
     * @param customerRevenueBO
     */
    void modifyCustomerRevenueCache(Long customerId, Integer level, CustomerRevenueBO customerRevenueBO);

    /**
     * 获取缓存信息
     * @param customerId
     * @param level
     * @return
     */
    CustomerRevenueBO getCustomerRevenueCache(Long customerId, Integer level);

    /**
     * 查询用户提现申请时可用余额
     * @param customerId
     * @param level
     * @return
     */
    CustomerWithdrawalsInfoVO getCustomerWithdrawalsInfo(Long customerId, Integer level);

    /**
     * 用户提现
     * @param customerUser
     * @param condition
     */
    void customerWithdrawals(CustomerUser customerUser, CustomerApplyWithDrawCondition condition);

    /**
     * 今天微信剩余提现额度
     * @param customer
     * @return
     */
    BigDecimal getSumTodayTotalFeeByCustomerId(Long customer);
}
